package com.adobe.cairngorm.samples.store.command {
	
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import com.adobe.cairngorm.samples.store.business.ProductDelegate;
	import com.adobe.cairngorm.samples.store.event.SaveProductEvent;
	import com.adobe.cairngorm.samples.store.vo.ProductVO;
	
	import mx.rpc.IResponder;

	public class SaveProductCommand implements ICommand, IResponder {
		
		public function execute(event:CairngormEvent):void {
			var evt:SaveProductEvent = event as SaveProductEvent
			var delegate:ProductDelegate = new ProductDelegate(this);
			var productVO:ProductVO = evt.product;
			productVO.name = "new name"
			delegate.saveProduct(productVO);
		}
		
		public function result(data:Object):void {
			
		}
		
		public function fault(info:Object):void {
			
		}
		
	}
}